﻿using System;
using System.Web.UI;
using System.ComponentModel;

namespace Basic4Net.OAWeb.Base
{
	public class BaseUserControl : UserControl
	{
		/// <summary>
		/// 获取对包含服务器控件的BasePage实例引用
		/// </summary>
		public BasePage _Page
		{
			get
			{
				return (BasePage)base.Page;
			}
			set
			{
				base.Page = value;
			}
		}

		/// <summary>
		/// 点击Accept按钮后，要调用的Js方法。
		/// </summary>
		[Category("Js事件")]
		[Browsable(true)]
		[Description("点击Accept按钮后，要调用的Js方法。")]
		public string ScriptAfterAccept
		{
			get
			{
				if (ViewState["ScriptAfterAccept"] == null)
					ViewState["ScriptAfterAccept"] = String.Empty;
				return (string)ViewState["ScriptAfterAccept"];
			}
			set
			{
				ViewState["ScriptAfterAccept"] = value;
			}
		}

		/// <summary>
		/// 点击Accept按钮后，要调用的Js方法。
		/// </summary>
		[Category("Js事件")]
		[Browsable(true)]
		[Description("点击Cancel按钮后，要调用的Js方法。")]
		public string ScriptAfterCancel
		{
			get
			{
				if (ViewState["ScriptAfterCancel"] == null)
					ViewState["ScriptAfterCancel"] = String.Empty;
				return (string)ViewState["ScriptAfterCancel"];
			}
			set
			{
				ViewState["ScriptAfterCancel"] = value;
			}
		}

		/// <summary>
		/// 在show之前，要调用的Js方法。
		/// </summary>
		[Category("Js事件")]
		[Browsable(true)]
		[Description("在show之前，要调用的Js方法。")]
		public string ScriptBeforeShow
		{
			get
			{
				if (ViewState["ScriptBeforeShow"] == null)
					ViewState["ScriptBeforeShow"] = String.Empty;
				return (string)ViewState["ScriptBeforeShow"];
			}
			set
			{
				ViewState["ScriptBeforeShow"] = value;
			}
		}
	}
}